package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CommunityUserMapper;
import com.ruoyi.system.domain.CommunityUser;
import com.ruoyi.system.service.ICommunityUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 社群用户关系Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-12
 */
@Service
public class CommunityUserServiceImpl implements ICommunityUserService 
{
    @Autowired
    private CommunityUserMapper communityUserMapper;

    /**
     * 查询社群用户关系
     * 
     * @param id 社群用户关系主键
     * @return 社群用户关系
     */
    @Override
    public CommunityUser selectCommunityUserById(String id)
    {
        return communityUserMapper.selectCommunityUserById(id);
    }

    /**
     * 查询社群用户关系列表
     * 
     * @param communityUser 社群用户关系
     * @return 社群用户关系
     */
    @Override
    public List<CommunityUser> selectCommunityUserList(CommunityUser communityUser)
    {
        return communityUserMapper.selectCommunityUserList(communityUser);
    }

    /**
     * 新增社群用户关系
     * 
     * @param communityUser 社群用户关系
     * @return 结果
     */
    @Override
    public int insertCommunityUser(CommunityUser communityUser)
    {
        communityUser.setCreateTime(DateUtils.getNowDate());
        return communityUserMapper.insertCommunityUser(communityUser);
    }

    /**
     * 修改社群用户关系
     * 
     * @param communityUser 社群用户关系
     * @return 结果
     */
    @Override
    public int updateCommunityUser(CommunityUser communityUser)
    {
        communityUser.setUpdateTime(DateUtils.getNowDate());
        return communityUserMapper.updateCommunityUser(communityUser);
    }

    /**
     * 批量删除社群用户关系
     * 
     * @param ids 需要删除的社群用户关系主键
     * @return 结果
     */
    @Override
    public int deleteCommunityUserByIds(String ids)
    {
        return communityUserMapper.deleteCommunityUserByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除社群用户关系信息
     * 
     * @param id 社群用户关系主键
     * @return 结果
     */
    @Override
    public int deleteCommunityUserById(String id)
    {
        return communityUserMapper.deleteCommunityUserById(id);
    }
}
